package pl.maciejziarko.mshare.dto;

import javax.validation.constraints.Size;

/**
 * @author Maciej Ziarko
 */
public class LoginDTO {

    @Size(min = Rules.MIN_USERNAME_LENGTH, max = Rules.MAX_USERNAME_LENGTH,
            message = "Invalid username!")
    protected String username;

    @Size(min = Rules.MIN_PASSWORD_LENGTH,
            message = "Invalid password!")
    protected char[] password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public char[] getPassword() {
        return password;
    }

    public void setPassword(char[] password) {
        this.password = password;
    }

    @Override
    public String toString() {
        return "LoginDTO{" +
                "username='" + username + '\'' +
                ", password=" + (password != null ? "'not null'" : "'null'") +
                '}';
    }
}
